<div>
    <el-form ref="editForm" :model="form" label-width="100px" label-position="left">

        <el-form-item label="商品类型" prop="productType" :rules="{ required: true, message: '商品类型 不能为空'}">
            <el-radio-group v-model="form.productType" :disabled="editType=='update'">
                <el-radio :label="item.value" v-for="(item,index) in $vFN.Constants.DictGoodsType.list"
                    :key="item.value">
                    {{item.label}}</el-radio>
            </el-radio-group>
        </el-form-item>
        <el-form-item label="商品类目" prop="categoryIds" :rules="{ required: true, message: '商品类目 不能为空'}">
            <el-cascader placeholder="试试搜索类目名称" :disabled="editType=='update'" v-model="form.categoryIds"
                :options="categoryOptions" filterable>
            </el-cascader>
        </el-form-item>

        <el-form-item label="商品名称" prop="name" :rules="{ required: true, message: '商品名称 不能为空'}">
            <el-input v-model="form.name" maxlength="60" show-word-limit></el-input>
        </el-form-item>
        <el-form-item label="商品标语" prop="subTitle">
            <el-input v-model="form.subTitle" maxlength="60" show-word-limit></el-input>
        </el-form-item>
        <el-form-item label="商品简称" prop="shortName">
            <el-input v-model="form.shortName" maxlength="60" show-word-limit></el-input>
        </el-form-item>
        <!-- :rules="[{trigger: ['blur', 'change'] ,validator: validateLimit}]" -->
        <el-form-item label="SKU编码" prop="productCode" >
            <el-input v-model="form.productCode"></el-input>
        </el-form-item>
        <el-form-item label="添加图片" prop="imageUrlLst"
            :rules="{ required: true,type: 'array',  message: '商品图片 最少一张', trigger: ['blur', 'change']}">
            <SelectImageCheckbox :appWindow="appWindow" v-model="form.imageUrlLst" :count="5" @change="validate"
                :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)">
                <template slot-scope="scope" slot="item">
                    <img class="SelectResourcesImg" :src="scope.src" />
                    <div class="firstImg" v-if="scope.index==0">主图</div>
                </template>
            </SelectImageCheckbox>
        </el-form-item>
        <el-form-item label="主图视频" prop="videoUrl">
            <SelectVideoRadio :video.sync="form.videoUrl" :cover.sync="form.videoAlbumUrl" :appWindow="appWindow" @change="setVideoValue"
            :apiConfig="$vFN.Tools.getAppGlobalData('selectResourcesImageApiConfig.resourcesImageBox', appWindow)"></SelectVideoRadio>
        </el-form-item>
    </el-form>
</div>
